<?php if (is_array($models) && count($models) > 0) : ?>
    <div class="products">
    <?php foreach($models as $model) : $detailUrl = $this->controller->createUrl('/Product/default/view',array('cat_id'=>$model->category_id,'locale'=>$model->localeProduct->locale,'id'=>$model->id,'alias'=>$model->localeProduct->alias)); ?>
        <div class="item" style="margin-bottom: 10px;">
            <a class="product-image" href="<?php echo $detailUrl; ?>"><img src="<?php echo image_path($model->images); ?>" alt="<?php echo $model->localeProduct->name;?>" /></a>
            <div class="product-name"><a href="<?php echo $detailUrl; ?>"><?php echo $model->localeProduct->name;?></a></div>
            <div class="hidden-product-info">
                <?php if(intval($model->price) > 0) : ?><p><?php echo '<b>'.Yii::t('site/product','Price').' : </b>'.number_format($model->price).' '.$model->currency; ?></p><?php endif; ?>
                <?php if (trim($model->localeProduct->source)!='') : ?><p><?php echo '<b>'.Yii::t('site/product','Source').' : </b>'.$model->localeProduct->source; ?></p><?php endif; ?>
                <div><?php echo $model->localeProduct->short_description; ?></div>
            </div>
        </div>
    <?php endforeach; ?>
    </div>
    <div style="clear: both;"></div>
    <div class="pager">
        <?php
        $this->widget('CLinkPager',array(
            'pages' => $paging,
            'cssFile' => false,
            'header' => ''
        )); ?>
    </div>
    
    <script type="text/javascript">
    $(document).ready(function(){
        $('.products a.product-image, .products .product-name a').tooltip({
           bodyHandler: function() {
             return $(this).closest('.item').find('.hidden-product-info').html();
           },
           showURL: false
        });
    });
    </script>
<?php else : ?>
    <p><?php echo Yii::t('site/product','No product in this category'); ?></p>
<?php endif; ?>